package com.meiya.baseweb.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement
public class Fact extends BasicEntity {
	/**
	 * 舆情触发事件
	 */
	private static final long serialVersionUID = 1L;

	private String title; //标题
	private Integer recognizedTime; //时间
	private Integer lastDays; //持续时间段
	private String description; //描述
	
	@OneToOne(cascade = CascadeType.REFRESH)
	@JoinColumn(name = "thePubopinion")
	@NotFound(action = NotFoundAction.IGNORE)
	private Pubopinion thePubopinion; //舆情信息

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getRecognizedTime() {
		return recognizedTime;
	}

	public void setRecognizedTime(Integer recognizedTime) {
		this.recognizedTime = recognizedTime;
	}

	public Integer getLastDays() {
		return lastDays;
	}

	public void setLastDays(Integer lastDays) {
		this.lastDays = lastDays;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	@XmlTransient	
	public Pubopinion getThePubopinion() {
		return thePubopinion;
	}

	public void setThePubopinion(Pubopinion thePubopinion) {
		this.thePubopinion = thePubopinion;
	}

}
